package com.example.eureka.service.department.service;

import com.example.eureka.service.department.domain.Department;
import com.example.eureka.service.department.mapper.DepartmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    public Department getDepartment(Long id) {
        return departmentMapper.selectByPrimaryKey(id);
    }

    public List<Department> listDepartment() {
        return departmentMapper.selectAll();
    }
}
